# 1  编写一个装饰器，能计算其他函数的运行时间；
import time

def wrapper(fn):
    def inner(*args, **kwargs):
        start = time.time()
        fn(*args, **kwargs)
        end = time.time()
        print(f'spend {end-start}')
    return inner

@wrapper
def func1(sleep_time):
    time.sleep(sleep_time)

@wrapper
def func2(sleep_time):
    time.sleep(sleep_time)


if __name__ == '__main__':
    func1(0.5)
    func2(0.8)